<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    #canvas {
      display: block;
      background-color: rgb(95, 95, 95);
    }
  </style>
</head>
<body>
  <canvas id="canvas" width="500" height="500"></canvas>
  <button class="btn">开启</button>
</body>
<script src="./scene.js"></script>
<script>
  let $ = sel => document.querySelector(sel)
  let data = [
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ad', author: '' },
    { type: 0, text: 'a爱得外', author: '' },
    { type: 0, text: '啊嘚嘚', author: '' },
    { type: 1, text: '歪歪', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 1, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 1, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 1, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 1, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 1, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: '外', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '啊得爱的', author: '' },
    { type: 0, text: '歪歪', author: '' },
    { type: 0, text: '歪哇大的', author: '' },
    { type: 0, text: '绘图', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: '外', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 1, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
    { type: 0, text: 'ajdi安定哦7', author: '' },
  ]
  
  let ctx = canvas.getContext('2d')
  let btn = $('.btn')
  btn.onclick = function() {
    barrage.start()
  }
  let barrage = new Barrage(data, {
    ctx,
    width: 500,
    height: 500,
  })

</script>
</html>